package net.pimpas.web.tests.bb;

import java.util.ArrayList;
import java.util.List;

import net.pimpas.web.jsf.components.simplemenu.SimpleMenu;
import net.pimpas.web.jsf.components.simplemenu.SimpleMenuItem;
import net.pimpas.web.jsf.components.simplemenu.impl.SimpleMenuImpl;
import net.pimpas.web.jsf.components.simplemenu.impl.SimpleMenuItemImpl;
import net.pimpas.web.jsf.components.simplemenu.impl.SimpleMenuSeparatorImpl;
import net.pimpas.web.jsf.managedbean.ManagedBeanAnnotation;

@ManagedBeanAnnotation(beanName="testeMenu")
public class MenuTeste {

	private List<SimpleMenu> menu;
	
	public MenuTeste() {
		this.setMenu(new ArrayList<SimpleMenu>());
		SimpleMenu menu = new SimpleMenuImpl("pets_menu");
		menu.setLabel("Pets");
		
		SimpleMenu dog = new SimpleMenuImpl("dog_menu");
		dog.setLabel("Dogs");
		
		SimpleMenuItem schnauzer = new SimpleMenuItemImpl("schanuzer_item");
		schnauzer.setLabel("schnauzer");
		schnauzer.setAction("page_schanuzer");
		schnauzer.setTooltip("Schnauzer Dog, very very beautiful");
		
		dog.addChild(schnauzer);
		
		SimpleMenuItem cat = new SimpleMenuItemImpl("cat_item");
		cat.setLabel("Cat");
		cat.setAction("page_cat");
		
		SimpleMenuItem fish = new SimpleMenuItemImpl("fish_item");
		fish.setLabel("Fish");
		fish.setAction("page_fish");
		
		menu.addChild(dog);
		menu.addChild(cat);
		menu.addChild(new SimpleMenuSeparatorImpl());
		menu.addChild(fish);
		
		this.getMenu().add(menu);
	}

	public List<SimpleMenu> returnMenus() {
		return this.getMenu();
	}

	public List<SimpleMenu> getMenu() {
		return menu;
	}

	public void setMenu(List<SimpleMenu> menu) {
		this.menu = menu;
	}
}